<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="id588738"></a><span style=" font-size:9pt;">К</span><span style=" font-size:9pt;">ак проверить наличие таблицы в базе??  [new] </span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; vertical-align:top;">Исходя из предположения что сервер доступен проверим наличие одной таблицы открыв RecordSet и поймав ошибку .Вместо CurrentDb у нас будет CurrentProject что экономит на написании строк подключения и передаче пароля <br /><br /></span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Sub</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> test</span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">()</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Dim</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> rst                   </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">As</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> ADODB.Recordset</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Set</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> rst </span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">New</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> ADODB.Recordset</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">On</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Error</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">GoTo</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> Bad_Table</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    rst.Open </span><span style=" font-family:'Courier New'; font-size:10pt; color:#808080;">&quot;Name_Table&quot;</span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">,</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> CurrentProject.Connection</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    MsgBox </span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">(</span><span style=" font-family:'Courier New'; font-size:10pt; color:#808080;">&quot;YES Name_Table&quot;</span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">)</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    rst.Close</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Set</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> rst </span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Nothing</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Exit</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Sub</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">Bad_Table</span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">:</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;">    MsgBox </span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">(</span><span style=" font-family:'Courier New'; font-size:10pt; color:#808080;">&quot;NO Name_Table&quot;</span><span style=" font-family:'Courier New'; font-size:10pt; font-weight:600; color:#000000;">)</span> </p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">End</span><span style=" font-family:'Courier New'; font-size:10pt; color:#000000;"> </span><span style=" font-family:'Courier New'; font-size:10pt; color:#0000ff;">Sub</span> </p>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">  </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt; color:#0000ff; vertical-align:top;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">T-SQL: <br /></span></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="80%" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="10" bgcolor="#faf0e6">
<tr>
<td>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New,courier'; font-size:9pt; color:#0000ff;">IF</span><span style=" font-family:'Courier New,courier'; font-size:9pt;"> </span><span style=" font-family:'Courier New,courier'; font-size:9pt; color:#0000ff;">EXISTS</span><span style=" font-family:'Courier New,courier'; font-size:9pt;"> (</span><span style=" font-family:'Courier New,courier'; font-size:9pt; color:#0000ff;">SELECT</span><span style=" font-family:'Courier New,courier'; font-size:9pt;"> name </span><span style=" font-family:'Courier New,courier'; font-size:9pt; color:#0000ff;">FROM</span><span style=" font-family:'Courier New,courier'; font-size:9pt;"> sysobjects </span><span style=" font-family:'Courier New,courier'; font-size:9pt; color:#0000ff;">WHERE</span><span style=" font-family:'Courier New,courier'; font-size:9pt;"> name = </span><span style=" font-family:'Courier New,courier'; font-size:9pt; font-weight:600; color:#008000;">&quot;your name&quot;</span><span style=" font-family:'Courier New,courier'; font-size:9pt;"> </span><span style=" font-family:'Courier New,courier'; font-size:9pt; color:#0000ff;">AND</span><span style=" font-family:'Courier New,courier'; font-size:9pt;"> TYPE = </span><span style=" font-family:'Courier New,courier'; font-size:9pt; font-weight:600; color:#008000;">&quot;your type&quot;</span><span style=" font-family:'Courier New,courier'; font-size:9pt;">)...</span></p></td></tr></table></td></tr></table></body></html>